home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1986 March / 1986-03.d64 / key to joy demo (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  46 lines

  1. 1 print"[147][159]to use a joystick with this program"
  2. 2 print"you must first load the menu and run"
  3. 3 print"'power basic - keyboard to joystick'[159]."
  4. 4 print"when prompted for the key's used enter"
  5. 5 print"i[159],m[159],j[159],k[159] for up/down/left/right and any"
  6. 6 print"key for the firebutton. then load and"
  7. 7 print"run 'mn[159]' to reload the menu."
  8. 8 print"  press 'm'[159] to reload the menu"
  9. 9 print"  press any other key to run the demo"
  10. 10 poke198,0:wait198,1:getmt$:ifmt$=""then10
  11. 11 ifmt$<>"m"then100
  12. 15 poke53280,14:poke53281,14:print"[147][154]load";chr$(34);"nt";chr$(34);",8"
  13. 16 a$=chr$(13)+"run"+chr$(13)
  14. 17 fori=1tolen(a$):poke630+i,asc(mid$(a$,i)):next:poke198,i-1
  15. 18 new
  16. 99 stop
  17. 100 poke53281,6:print"[147][159]"tab(16)"*** key to joy demo ***":a=rnd(0)
  18. 110 poke53280,0:poke53281,0:fori=0to19:poke1083-i,160:poke1084+i,160:nexti
  19. 120 fori=0to21:poke1104+i*40,160:poke1143+i*40,160:nexti
  20. 130 fori=0to19:poke1984+i,160:poke2023-i,160:nexti
  21. 140 dims(999):wh=292:wt=wh:d=1:pokewh+1024,81:s(wh)=d:gosub320:gosub350
  22. 150 geta$:d1=d
  23. 160 ifa$="j"thend=-1
  24. 170 ifa$="k"thend=1
  25. 180 ifa$="i"thend=-40
  26. 190 ifa$="m"thend=40
  27. 200 ifd=-d1thend=d1
  28. 210 s(wh)=d:wh=wh+d
  29. 220 ifpeek(wh+1024)=65thensc=sc+10:gosub350:gosub320:gosub320:l=5:goto240
  30. 230 ifpeek(wh+1024)<>32then270
  31. 240 pokewh+1024,81:iflthenl=l-1:goto260
  32. 250 pokewt+1024,32:wt=wt+s(wt)
  33. 260 fort=1to25:nextt:goto150
  34. 270 p=peek(wh+1024):pokewh+1024,86:print:print:printtab(2)chr$(18)"you ran ";
  35. 280 ifp=81thenprint"over yourself"
  36. 290 ifp=160thenprint"into a wall"
  37. 300 print:printtab(2)chr$(18)"game over"
  38. 302 printspc(6)"press any key to play again"
  39. 305 poke198,0:wait198,1:getmt$:ifmt$=""then305
  40. 306 run100
  41. 310 rem *** grow mushrooms ***
  42. 320 r=int(rnd(1)*960)+1064:ifpeek(r)<>32then320
  43. 330 poker,65:return
  44. 340 rem *** print score ***
  45. 350 printchr$(19)"score: "right$("0000"+mid$(str$(sc),2),5):return
  46.